package FSMDemo.entity.Harvester
{
	
	import FSMDemo.entity.Harvester.Harvester;
	
	import com.cheezeworld.entity.Entity;
	import com.cheezeworld.entity.GameCamera;
	import com.cheezeworld.rendering.SpriteRenderer;
	import com.urbansquall.ui.CustomTextField;
	
	import flash.display.DisplayObjectContainer;

	public class HarvesterRenderer extends SpriteRenderer
	{
		
		/**
		 * 
		 * @param a_data Should contain the variable sprite:Class
		 * 
		 */	
		public function HarvesterRenderer(a_entity:Entity, a_camera:GameCamera, a_canvas:DisplayObjectContainer, a_data:Object)
		{
			super(a_entity, a_camera, a_canvas, a_data);
			
			m_statusText = new CustomTextField( "Test", 0xFF0000, 14);
			_container.parent.addChild( m_statusText );
		}
		
		protected override function draw():void
		{
			super.draw();
			
			m_statusText.text = Harvester(_entity).status;
			m_statusText.x = _container.x - m_statusText.width / 2;
			m_statusText.y = _container.y - _container.height / 2 - m_statusText.height;
		}
		
		private var m_statusText:CustomTextField;
		
	}
}